package com.city.java.base.utils;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@Data
public class PageVO <E>{
    @ApiModelProperty(value = "数据列表")
    private List<E> list;
    @ApiModelProperty(value = "总页数")
    private Long totalPage;

    // 计算页面偏移量
    public static Integer build(Integer pageNum, Integer pageSize) {
        if (pageNum != null && pageSize != null) {
            return (pageNum - 1) * pageSize;
        }else {
            return -1;
        }
    }
}
